-
Notifications
You must be signed in to change notification settings - Fork 858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for multiple Azkaban Host URL #342
Conversation
* Constructor of the class | ||
* @param url | ||
*/ | ||
public AzkabanJobStatusUtil(String url) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this class can be marked as a singleton?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is not thread safe, whoever is using this class need to make sure that it runs only one request at a time. So we need to first make it thread safe or make it a utility kind of class before making it singleton.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not happy with keeping the login state in a utility method. Ideally, the login should be done in a separate class (workflowClient itself) and then you can call this utility method by passing the workflowClient object to it. This way the login can be reused for other utilities and the utility methods also remain stateless and easily testable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently also login method is called form outside. As we discussed we will create a task to refactor this and take it up with in one month.
_workflowClient.setURL(execUrl); | ||
return _workflowClient.getJobsFromFlow(); | ||
AzkabanWorkflowClient workflowClient = getWorkflowClient(execUrl); | ||
workflowClient.setURL(execUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required? Doesn't the previous line already return the updated client for the url.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, first line is only returning the workflowClient, next line is setting the url.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The url seems to be already set when you call getWorkflowClient(execUrl)
. The explicit setURL in the next line seems redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are talking about this code getWorkflowClientInstance(scheduler, url), then this is only getting called when first time WorkflowClient is created, after that it will always pick up from the map.
I have approved the changes only to unblock you guys. Please make sure you address them asap. |
Currently Auto Tuning does not support job execution IDs from different azkaban host and it fails while calling azkaban rest api. This PR have changes to support multiple azkaban host and it also takes care of creating new session every hour for azkaban rest api.